]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyring: Allow user to correct password after checking failed
authorAlynx Zhou <alynx.zhou@gmail.com>
Fri, 20 Jun 2025 15:05:28 +0000 (23:05 +0800)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 28 Jun 2025 10:24:36 +0000 (12:24 +0200)
Currently we make entries and buttons insensitive and do some checks
before calling the GcrPrompt implementation to complete. However, if
checks get failed, for example, new passwords mismatched due to typo,
we should make entries and buttons sensitive again to allow user to
correct it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3757>
(cherry picked from commit 889a46670d81fbbdf6c856e16094617ead4ca035)

js/ui/components/keyring.js

index 433535e9d7b6607306c2661e57f160efffd69263..3044d0ad042d4d42865a153276063787b2858809 100644 (file)
@@ -173,7 +173,12 @@ class KeyringDialog extends ModalDialog.ModalDialog {
 
     _onContinueButton() {
         this._updateSensitivity(false);
-        this.prompt.complete();
+        if (this.prompt.complete())
+            return;
+        // Allow user to correct it when passwords mismatch.
+        this._updateSensitivity(true);
+        if (this.prompt.password_visible)
+            this._passwordEntry.grab_key_focus();
     }
 
     _onCancelButton() {